﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Kepp.Extend
{
    /// <summary>
    /// 输入方法
    /// </summary>
    public class import 
    {
        public sbyte li { get; set; } = 0;
        /// <summary>
        /// 问候语
        /// </summary>
        public import CW()
        {
            Console.Write("请输入数字选择标题");
            return this;
        }
        /// <summary>
        /// 字符串
        /// </summary>
        /// <returns></returns>
        //public string String()
        //{
        //    return Value;
        //}

        /// <summary>
        /// sbyte类型
        /// </summary>
        /// <returns></returns>
        public sbyte Sbyte()
        {
            Console.WriteLine("请输入...");
            string value = Console.ReadLine();
            sbyte i = 0;
            if (sbyte.TryParse(value, out i))
            {
                return i;
            }
            else
                return Error().Sbyte();
        }

        /// <summary>
        /// 异常提示
        /// </summary>
        public import Error()
        {
            Console.WriteLine("！！！输入不合法！！！\n请重新输入..。");
            return this;
        }
    }
}
